package com.kabigon.consumer;

import com.kabigon.message.Demo01Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.consumer
 * @data 2023/3/5 16:52
 */
@Component
@RabbitListener(queues = Demo01Message.QUEUE)
public class Demo01Consumer {
    private final Logger logger = LoggerFactory.getLogger(getClass());
    @RabbitHandler
    public void onMessage(Demo01Message message) {
        logger.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }

}
